﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Gollie.Controls.BoundFields
{
	public class BoundFieldOffersAvailable : BoundField
	{
		private static string defaultText = "Onbeperkt";

		protected override string FormatDataValue(object dataValue, bool encode)
		{
			if (dataValue == null)
				return defaultText;

			int offerLeft = Convert.ToInt32(dataValue);

			return offerLeft > 99999999 ? defaultText : offerLeft.ToString();
		}
	}
}